<ul id='main-site-globalbo-moduleSpace-flat-detail-pictures-ul'>
	<!-- loop pictures -->
		<li class='main-site-globalbo-moduleSpace-flat-detail-pictures-li'>
			<img class="show-big_picture" src="{{baseurl}}global/img/appartements/pictures/thumbnails/{{pictures' value}}" alt='image'>
			<div class='pictures-detail'>
				<span class='item'>
					<img class='pictures-detail-delete' src='{{baseurl}}global/img/globalbo/appartements/delete-128.png' alt='Supprimer'>
					<input type='hidden' class='pictures-detail-pic' name='id_pic' value="{{pictures' value}}">
				</span> 
				<span class='item'>
					<img class='pictures-detail-show' src='{{baseurl}}global/img/globalbo/appartements/search-128.png' alt='Afficher en grand'>
					<input type='hidden' class='pictures-detail-pic' name='id_pic' value="{{pictures' value}}">
				</span> 
				
			</div>			
		</li>
	<!-- endloop -->
</ul>

<script type="text/javascript">
showPicture = function(){
				var id_pic = $(this).siblings('.pictures-detail-pic').val();
				$('#component-show-image-img').attr('src', '{{baseurl}}global/img/appartements/pictures/'+id_pic);
				$("#component-show-image").show();
			}

$(".pictures-detail-delete").click(function(){
	var id_appart = $("#appart_id_modif").val().replace("appart_", "");
	var id_pic = $(this).siblings('.pictures-detail-pic').val();
	url="{{baseurl}}admin/frbFlat/frbFlat_MainController/appartements";
	if(confirm("Etes-vous sûr de vouloir supprimer\n\t\tcette photo")){
		$.ajax({
			urlApp: url,
			type: 'POST',
			cache: false,
			data: "del_picture=true&id_flat="+id_appart+"&id_pic="+id_pic,
			success: function(html){
				loadPictures(id_appart);
			}
		});
	}
});


$(".pictures-detail-show").click(showPicture);
$('.show-big_picture').click(function(){
	var picture = $(this).attr("src");
	picture = picture.replace("thumbnails/", "");
	$('#component-show-image-img').attr('src', picture);
	$("#component-show-image").show();
});


</script>